package com.ruoyi.edh.service;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.edh.domain.EdhOrder;
import com.ruoyi.edh.domain.dto.EdhBatchShipDto;
import com.ruoyi.edh.domain.dto.EdhOrderGoodsDto;
import com.ruoyi.edh.domain.dto.EdhOrderListDto;
import com.ruoyi.edh.domain.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

/**
 * 易订购-订单Service接口
 *
 * @author xxx
 * @date 2020-09-03
 */
public interface IEdhOrderService
{
    /**
     * 查询易订购-订单
     *
     * @param id 易订购-订单ID
     * @return 易订购-订单
     */
    public EdhOrder selectEdhOrderById(Long id);

    /**
     * 查询易订购-订单列表
     *
     * @param edhOrder 易订购-订单
     * @return 易订购-订单集合
     */
    public List<EdhSummaryOrderListVo> selectEdhOrderList(EdhOrderListDto edhOrder);
    /**
     *
     *
     * @description: excle导出
     * @param edhOrder
     * @return: EdhSummaryOrderListVo
     * @author: 梁东宸
     * @time: 2020/9/17 3:10 下午
     */
    public List<EdhSummaryOrderExcleListVo> selectEdhOrderExcelList(EdhOrderListDto edhOrder);

    /**
     * 新增易订购-订单
     *
     * @param edhOrder 易订购-订单
     * @return 结果
     */
    public int insertEdhOrder(EdhOrder edhOrder);

    /**
     * 修改易订购-订单
     *
     * @param edhOrder 易订购-订单
     * @return 结果
     */
    public int updateEdhOrder(EdhOrder edhOrder);

    /**
     *@Author: 周爱鸿
     *@Description: 确认收货  增加收益  增加账单
     *@CreateDate: 2020/11/4 11:44
     */
    @Transactional(rollbackFor = Exception.class)
    public int insertProfitAndBill(Long orderid);

    /**
     * 批量删除易订购-订单
     *
     * @param ids 需要删除的易订购-订单ID
     * @return 结果
     */
    public int deleteEdhOrderByIds(String[] ids);

    /**
     * 删除易订购-订单信息
     *
     * @param id 易订购-订单ID
     * @return 结果
     */
    public int deleteEdhOrderById(Long id);

    /**
     * 查询我的订单
     * @param orderStatus
     * @return
     */
    public List<EdhMyOrderVo> selectEdhMyOrder( String orderStatus,String returnStatus);
    /**
     *
     *
     * @description: 查询微店订单
     * @param edhOrder 订单查询参数
     * @return: List<EdhMyOrderVo> 订单列表
     * @author: 梁东宸
     * @time: 2020/11/5 10:48 上午
     */
    public List<EdhMyOrderVo> selectMicroshopList(EdhOrderListDto edhOrder);
    /**
     *
     *
     * @description: 根据子订单id查询当前订单详情
     * @param id
     * @return:
     * @author: 梁东宸
     * @time: 2020/9/5 4:10 下午
     */
    public EdhDetailsOrderVo selectDetailsOrder(String id);

    /**
     * 获取订单销售情况
     */
    public Map<String,Object> getOrderFulfillment();

    /**
     * 首页待处理事务数据
     */
    public Map<String,Object> pendingTransaction();

    /**
     * 首页订单总数统计图数据
     */
    public Map<String,Object> totalOrdersStatistics(Integer type , String time);
    /**
     * 首页订单销售额统计图数据
     */
    public Map<String,Object> orderSalesStatistics(Integer type , String time);

	/**
	 * 首页订单总数对比数据
	 */
	public Map<String,Object> totalOrderComparison();

	/**
	 * 首页订单销售额对比数据
	 */
	public Map<String,Object> totalOrderSalesComparison();
    /**
     *
     *
     * @description: 批量发货
     * @param edhBatchShip
     * @return: Integer
     * @author: 梁东宸
     * @time: 2020/9/15 3:05 下午
     */
    public Integer batchShip(@Param("edhBatchShip") List<EdhOrder> edhBatchShip);
    /**
     *
     *
     * @description: 根据id查询订单详情
     * @param id
     * @return: EdhOrderDetailsVo
     * @author: 梁东宸
     * @time: 2020/9/15 8:37 下午
     */
    public EdhOrderDetailsVo selectOrderDetailsById(String id);
    /**
     *
     *
     * @description:  添加操作记录
     * @param id,remarks 订单id和操作备注
     * @return:
     * @author: 梁东宸
     * @time: 2020/9/16 4:01 下午
     */
    public Integer addOrderLog(Long id,String remarks,String type);

    /**
     *
     *
     * @description: 查询当前已完成付款未发货的
     * @param edhOrder
     * @return: List<EdhOrderDetailsVo>
     * @author: 梁东宸
     * @time: 2020/9/17 9:45 上午
     */
    public List<EdhOrderDetailsVo> selectNotShipOrder(EdhOrder edhOrder);
    /**
     *
     *
     * @description:  批量修改上架状态
     * @param ids
     * @return: Integer
     * @author: 梁东宸
     * @time: 2020/9/17 1:42 下午
     */
    public Integer printShip(Long[] ids);
    /**
     *
     *
     * @description: 修改状态
     * @param edhOrder
     * @return: Integer
     * @author: 梁东宸
     * @time: 2020/9/18 9:35 上午
     */
    public Integer updateOrderStatus(EdhOrder edhOrder);

    /**
     * 根据主订单修改付款的订单失败
     * @param outTradeNo
     * @return
     */
    public Integer updateOrderStatusFailure(String outTradeNo);

    int cancelAftermarket(Long orderId);
}
